// 云函数列表
const functionMap = {
  version: 1,
  mixin(key, name, target, { desc, group, icon }) {
    functionMap[key] = {
      type: "function",
      key,
      name,
      desc,
      target,
      group,
      icon,
    };
  },
};

//白码基础
functionMap.mixin("common", "白码基础API", "/api/libs/common/index.js", {
  desc: "白码基础API",
  group: ["common"],
});

//企业微信
functionMap.mixin(
  "wxwork",
  "企业微信API(内部应用)",
  "/api/libs/wxwork/index.js",
  {
    desc:
      "功能说明:对接企业微信内部应用API;支持考勤/打卡,人员,审批等数据对接。比起第三方企业微信支持更多功能对接。",
    group: ["wechat"],
    icon: "/api/resources/image/icon_wxwork.png",
  }
);

//企业微信第三方
functionMap.mixin(
  "wxwork_third",
  "企业微信API(第三方)",
  "/api/libs/wxwork_third/index.js",
  {
    desc:
      "功能说明:对接企业微信第三方应用API;需要先授权集成企业微信功能;支持人员,审批等数据对接。",
    group: ["wechat"],
    icon: "/api/resources/image/icon_wxwork.png",
  }
);

//钉钉
functionMap.mixin("dingtalk", "钉钉API", "/api/libs/dingtalk/index.js", {
  desc: "功能说明:钉钉内部开发API;支持考勤/打卡,人员,审批等数据对接。",
  group: ["dingtalk", "alibaba"],
  icon: "/api/resources/image/icon_dingtalk.png",
});

//微信支付
functionMap.mixin("weixinpay", "微信支付API", "/api/libs/weixinpay/index.js", {
  desc: "功能说明:微信支付API;支持支付,退款等API对接。",
  group: ["pay", "wechat"],
  icon: "/api/resources/image/icon_weixinpay.png",
});

//微信公众号
functionMap.mixin("weixinmp", "微信公众号API", "/api/libs/weixinmp/index.js", {
  desc: "功能说明:微信公众号API;支持推送信息,用户管理等数据对接。",
  group: ["wechat"],
  icon: "/api/resources/image/icon_weixin.png",
});

//百度智能云
functionMap.mixin(
  "baidu-aip",
  "百度智能云API",
  "/api/libs/baidu-aip/index.js",
  {
    desc:
      "功能说明:百度智能云API,包含人脸识别,语音合成&语音识别,文字识别,内容审核,图像识别,图像搜索,知识图谱",
    group: ["baidu", "ai"],
    icon: "/api/resources/image/icon_baidu_aip.png",
  }
);

//支付宝
functionMap.mixin("alipay", "支付宝API", "/api/libs/alipay/index.js", {
  desc: "功能说明:支付宝API;支持支付,退款等API对接。",
  group: ["pay", "alibaba"],
  icon: "/api/resources/image/icon_alipay.png",
});

//淘宝
functionMap.mixin("taobao", "淘宝API", "/api/libs/taobao/index.js", {
  desc:
    "功能说明:支持淘宝/天猫数据对接;支持订单,商品,售后,物流,仓储等API对接。",
  group: ["shop", "alibaba"],
  icon: "/api/resources/image/icon_taobao.png",
});

//京东
functionMap.mixin("jd", "京东API", "/api/libs/jd/index.js", {
  desc: "功能说明:京东API;支持订单,商品,售后,物流,仓储等API对接。",
  group: ["shop"],
  icon: "/api/resources/image/icon_jd.png",
});

//拼多多
functionMap.mixin("pdd", "拼多多API", "/api/libs/pdd/index.js", {
  desc: "功能说明:拼多多API;支持订单,商品,售后,物流,仓储等API对接。",
  group: ["shop"],
  icon: "/api/resources/image/icon_pdd.png",
});

//腾讯云
functionMap.mixin(
  "tencentcloud",
  "腾讯云API",
  "/api/libs/tencentcloud/index.js",
  {
    desc:
      "功能说明:腾讯云API (nodejs);欢迎使用腾讯云开发者工具套件（SDK），NODEJS SDK 4.0 是云 API 3.0 平台的配套工具。目前已经支持 cvm、vpc、cbs 等产品，后续所有的云服务产品都会接入进来。",
    group: ["tencent"],
    icon: "/api/resources/image/icon_tencentcloud.png",
  }
);

//Sql
functionMap.mixin(
  "sql",
  "SQL数据库处理",
  "/api/libs/sql/index.js",
  {
    desc:
      "功能说明:使用 SQL orm 库 Sequelize 进行数据库对接;暂时支持 SQL SERVER 2008及以上版本;MySQL 5.0及以上版本;其他类型SQL数据库支持可联系进行接入",
    group: ["db"],
  }
);

export default functionMap;
